<?php
/**
 *  eigener Error Controller
 *  aus: http://codeutopia.net/blog/2009/03/02/handling-errors-in-zend-framework/
 *
 */
class ErrorController extends Zend_Controller_Action {
	public function errorAction() {
		$error = $this->_getParam('error_handler');
		switch(get_class($error->exception)) {
			case 'PageNotFoundException':
				$this->_forward('page-not-found');
				break;

			case 'NotAuthorizedException':
				$this->_forward('not-authorized');
				break;

			default:
				//put some default handling logic here
				break;
		}
	}

	public function pageNotFoundAction() {
		//goes here if the page was not found
	}

	public function notAuthorizedAction() {
		//goes here if the user has no access to a page
	}
}
